Use rfc6749 to standardize authorization code feature #107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, OAuth 2.0 Authorization Code flow is an experimental feature and doesn't use the good way to process the authorization code response.
Indeed, append a header
Authorization
with an encoding in base64client_id
+client_secret
doesn't work if the server which hosts the token endpoint follow the standards.So, this commit follow the rfc6749 and standardize authorization code feature.
Moreover,
client_secret
is not required during the access token request. However, if the token endpoint ask it, the dev' just add it in the configuration and it will be automatically add in the parameters.Edit: To resolve async issue on
callback
function (See issue #103), we return aPromise
instead ofundefined
. Documentation has been improved in this way.Edit 2: Sometimes, an user can keep
code
andstate
in the url parameters. JSO throw an error but in most of cases, tokens & authorization are ok. Now, we just log a line said it could not find retrieve state object.